<?php
	require_once './source/class/core.class.php';
	$core = &l3z_core::instance();
	$core->init();
	
	$res = 0;
	
	if ($_POST) {
		if ($_G['formhash'] != FORMHASH) {
			$res = 1;
			exit('Wrong');
		}
		
		if (!$res) {
			$content = $_G['gp_reply'];
			$reply = array();
			$reply['com_content'] = $content;
			$reply['reply_to'] = $_GET['mess_id'];
			$reply['author_id'] = $_G['uid'];
			DB::insert('comments', $reply);
		
			echo "<script>history.go(-1);location.href = document.referrer;</script>";		
		}
	}
?>